export declare type LifeCycleType = "setup"|"onBeforeMount"|"onMounted"|"onBeforeUpdate"|"onUpdated"|"onBeforeUnmount"|"onUnmounted"|"onActivated"|"onDeactivated"|"onErrorCaptured"
export declare type LifeCycle = {
    type: LifeCycleType,
    value: string
}
export declare type RD = Record<string, any>
export declare type BSN = boolean|string|number
export declare type BlockId = string

export declare type JsExpression = {
    type: "JsExpression",
    value: string
}
export declare type JsFunction = {
    type: "JsFunction",
    value: string
}
export declare type JsModel = {
    type: "JsModel",
    value: string
}

export declare type JsEF = JsExpression | JsFunction

export declare interface Node {
    nodeId: string
    nodeName: string
    props?: RD|Record<string, JsEF>
    children?: NodeChildren
    slots?: Record<string, JsEF|Node>
    blockId?: BlockId
    vIf?: BSN|(()=>BSN)
    vShow?: BSN|(()=>BSN)
    vFor?: {
        loops: any[]|(()=>any[])|RD|JsEF
        params: string[]
    }
}

export declare type NodeChildren = BSN|RD|JsEF|Node|Nodes

export declare type Nodes = Node[]

export declare type Asset = {
    css: string[],
    js: string[],
}

export declare interface BaseBlock {
    /**
     * 板块ID
     */
    id: BlockId,
    /**
     * 板块名称
     */
    name: string
    /**
     * 资源
     */
    asset?: Asset
    /**
     * 是否页面板块
     */
    isPage?: boolean
    /**
     * dsl节点
     */
    node: Node
}

export declare interface PageBlock extends BaseBlock {
    /**
     * 生命周期
     */
    lifeCycles?: LifeCycle[]
    /**
     * 数据存储
     */
    state?: Record<string, any>
    // 路由地址
    routerPath?: string
}

export declare interface Block extends BaseBlock {

}

export declare type Page = {

}

export declare interface Project {
    // 项目ID
    id: string
    // 项目名称
    name: string
    // 项目标题
    title: string
    // 模式 [dev=开始模式,prod=生产模式]
    mode: "dev" | "prod"
    // 是否显示调试信息
    debug?:boolean,
    pages: PageBlock[]
}
